<?php
namespace common\logic\sms;

class SmsCommon {
    
    public static function verifyParam(array &$param, array &$must) {
        if (isset($must)) {
            foreach ($must as $p) {
                if (!array_key_exists($p, $param)) {
                    return self::getDetail(Configs::ARGUMENT_MISSING, $p);
                    break;
                }
            }
        }
        return Configs::OK;
    }
    
    
    public static function getDetail($code = 0, $p){
        $array = [
            Configs::ARGUMENT_MISSING => '参数丢失'
        ];
        if(!$code || !isset($array[$code])){
            return $code;
        }
        return $p.':'.$array[$code];
    }
}